// 点餐相关接口
import http from "../../common/http.js";

export default {
  // 获取点餐推荐数据
  getMainInfo: (data) => {
    return http.GET("/plugin/food/index/main-info", data);
  },
  // 获取点餐列表数据
  getGoodsList: (data) => {
    return http.GET("/plugin/food/index/goods-list", data);
  },
  // 获取点餐首页数据
  getOrderMealPageData: (data) => {
    return http.GET("/md-food/goods-list", data);
  },
  // 加入购物车
  orderMealToCart: (data) => {
    return http.POST("/md-food/add-cart", data);
  },
  // 门店信息
  getMdInfo: (data) => {
    return http.GET("/md-food/md-info", data);
  },
  // 轮询购物车数据
  pollingCartData: (data) => {
    return http.GET("/md-food/query-goods", data);
  },
  // 轮询购物车数据
  reduceCartNum: (data) => {
    return http.POST("/md-food/update-num", data);
  },
  // 清空购物车
  clearAllCartData: (data) => {
    return http.POST("/md-food/clear-cart", data);
  },
  // 清空单人所选商品
  clearUserCartData: (data) => {
    return http.POST("/md-food/clear-cart", data);
  },
  // 关闭拼单
  closeSpellOrder: (data) => {
    return http.POST("/md-food/close", data);
  },
  // 用户点击选好了
  userCompleteSpell: (data) => {
    return http.POST("/md-food/user-complete", data);
  },
  // 更新门店数据
  updateMdData: (data) => {
    return http.GET("/md-food/md-info", data);
  },
  // 更新门店数据
  getUpdateMdData: (data) => {
    return http.GET("/md-food/get-md-info", data);
  },
  // 创建一个flag_id
  createStoreFlagId: (data) => {
    return http.POST("/md-food/flag", data);
  },
  // 查询用户是否拼单选好了
  checkUserSpellStatus: (data) => {
    return http.GET("/md-food/complete-status", data);
  },
  initGoodsCart: (data) => {
    return http.GET("/md-food/init-goods-cart", data);
  },
  getQrcodeInfo: (data) => {
    return http.POST("/md-food/get-qrcode-info", data);
  },
};
